<template>
  <div>
    home
    {{a}}
  </div>
</template>

<script>
import { mapState } from 'vuex'
import actions from '@/store/modules/app/actions'

const { loadData } = actions

export default {
  components: {},
  props: {
    a: {
      type: [String, Number]
    }
  },
  data () {
    return {

    }
  },
  computed: {
    ...mapState({
      testData: state => state.app.testData
    })
  },
  watch: {
    $route (to, from) {
      // 对路由变化作出响应...
      console.log('watch route', to, from)
    }
  },
  beforeRouteUpdate (to, from, next) {
    console.log('beforeRouteUpdate', to, from)
    // react to route changes...
    // don't forget to call next()
    next()
  },
  mounted () {
    const { meta } = this.$route
    console.log('meta', meta)
    this.loadData()
    // this.loadData()
  },
  methods: {
    loadData
  }
}
</script>

<style lang="less" scoped>

</style>
